package cn.com.blueInfo.bpm.system.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum DynamicFormFieldListShow implements BaseEnum<Integer> {

    /** 是否在列表中显示-是 */
    SHOW_IN_LIST(1, "是"),
    /** 是否在列表中显示-否 */
    HIDE_IN_LIST(0, "否");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static DynamicFormFieldListShow getByCode(Integer code) {
        return BaseEnum.getByCode(DynamicFormFieldListShow.class, code);
    }

    @JsonCreator
    public static DynamicFormFieldListShow getByName(String name) {
        return BaseEnum.getByName(name, DynamicFormFieldListShow.class);
    }
}
